import request from '@/utils/request'

export function getQueries(params) {
  return request({
    url: 'api/query',
    method: 'get',
    params
  })
}

export function getQuery(id) {
  return request({
    url: 'api/query/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'api/query',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/query',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/query',
    method: 'put',
    data
  })
}

export function distribute(data) {
  return request({
    url: 'api/query/distribute',
    method: 'post',
    data: data
  })
}

export function answerQuery(data) {
  return request({
    url: 'api/query/answerQuery',
    method: 'post',
    data: data
  })
}

export function replyQuery(data) {
  return request({
    url: 'api/query/replyQuery',
    method: 'post',
    data: data
  })
}

export default { add, edit, del, getQueries, getQuery, distribute, replyQuery }
